<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="zh-CN">
<head>    
    <meta charset="utf-8">    
    <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">    
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">    
    <meta name="format-detection" content="telephone=no, email=no">
    <meta name="keywords" content="关键字" />
    <meta name="description" content="描述" />
    <title>登陆</title>
    <link href="/wechat/Public/home/css/style.css" rel="stylesheet">
    <link rel="stylesheet" href="/wechat/Public/home/css/swiper.3.2.0.min.css" />                   
    <link rel="stylesheet" href="/wechat/Public/home/css/iconfont.css" />           
    <script src="/wechat/Public/home/js/jquery-1.11.1.min.js"></script>
    <script src="/wechat/Public/home/js/fastclick-min.js"></script>
    <script src="/wechat/Public/home/js/swiper.3.2.0.jquery.min.js"></script>
    <script src="/wechat/Public/home/js/script.js"></script> 
    <script src="/wechat/Public/layer/mobile/layer.js"></script> 
    <script src="/wechat/Public/js/ajaxfileupload.js"></script> 
    <script>
        layer.msg = function(msg,time){
            var durationTime = time ? time : 1;
            layer.open({content:msg,time:durationTime});
        }
        layer.note = function(msg,fun){
        	$('body').append('<div class="info-success">'+msg+'</div>')
        	setTimeout(function(){
        		if(fun != null){
        			$('.info-success').remove();
        			if(fun != null) fun();
        		}
        	},1200);
        }
        function toLogin(){
        	var str = '';
        	str += '<div class="fixed-bg" id="login_dialog">';
        	str += '<div class="del-goods">';
        	str += '<div class="close"><img src="/wechat/Public/home/images/close.png" onclick="$(\'#login_dialog\').remove()"></div>';
        	str += '<h3>温馨提示</h3>';
    		str += '<p>您暂时还尚未登录或注册</p>';
    		str += '<div class="clearfix del-goods-btn"><a href="<?php echo U("Login/register");?>">去注册</a><a href="<?php echo U("Login/index");?>">去登录</a></div>';
    		str += '</div>';
    		str += '</div>';
    		$('body').append(str);
        }
        function uploadImg(obj,fun){
        	var id = obj.id;
        	layer.open({type: 2});
        	$.ajaxFileUpload ({
        		 url:'<?php echo U("PicUpload/index");?>',
        		 secureuri:false,
        		 fileElementId:id,
        		 dataType: 'json',
        		 success: function (data,status){
        		 	if(fun != null)fun(data,id);
        		 	layer.closeAll();
        		 }
            });
        	return false;
        }
    </script>
</head>
<body style="[bdstyle]">




    <article class="load">
        <img src="/wechat/Public/home/images/logo.png" />
        <div class="data">
            <form id="dataForm">
                <input type="number" name="info[username]" oninput="if(value.length>11)value=value.slice(0,11)" placeholder="请输入手机号"/>
                <input type="password" name="info[password]" placeholder="请输入登录密码"/>
                <div class="code flex-justify">
                    <input type="text" name="yzcode" placeholder="请输入图形验证码">
                    <img onclick="this.src='<?php echo U('Common/code');?>?t='+Math.random()" style="width:32%;height:0.78rem;" src="<?php echo U('Common/code');?>" />
                    <!-- <div class="clearfix" ><img name="yzcode" src="<?php echo U('Common/code');?>" /></div>
                     -->
                </div>
                <a href="javascript:void(0)" id="saveBtn" >登录</a>
            </form>
            <div class="load-foot">
                <a href="<?php echo U('Login/resetPwd');?>">忘记密码</a>
                <a href="<?php echo U('Login/register');?>">用户注册</a>
            </div>
        </div>
   </article>
<script type="text/javascript">
$(function(){
	$('#saveBtn').click(function(){
		$.post(
			"<?php echo U('Login/doLogin');?>",
			$('#dataForm').serializeArray(),
			function(data){
				if(data.status == '1'){
					layer.msg(data.info);
					setTimeout("location.href='"+data.url+"'",1000);
				}else{
					layer.msg(data.info);
				}
			}
		)
	})
})
</script>

</body>
</html>